/*=====================================================================================================================
 * 
 * Repository path:     $HeadURL: http://sstu.googlecode.com/svn/tags/sstu-v40.23/src/include/DigitalIO.h $
 * Last committed:      $Revision: 7 $
 * Last changed by:     $Author: vladislav.gyurov@gmail.com $
 * Last changed date:   $Date: 2012-12-12 20:42:30 +0000 (Wed, 12 Dec 2012) $
 * ID:                  $Id: DigitalIO.h 7 2012-12-12 20:42:30Z vladislav.gyurov@gmail.com $
 *
 *===================================================================================================================*/
#ifndef DIGITALIO_H
#define DIGITALIO_H
    
/*----------------------------------------------------------------------------*/
/* Included files to resolve specific definitions in this file                */
/*----------------------------------------------------------------------------*/
#include "basedef.h"

/*----------------------------------------------------------------------------*/
/* Constant data                                                              */
/*----------------------------------------------------------------------------*/
/* Cartridge detection states */
#define CART_DET_SCAN_INIT				1
#define CART_DET_SCAN_ZERO_CROSS		2
#define CART_DET_SCAN_CARTRIDGE			3
#define CART_DET_WAIT_STATE				4

/*----------------------------------------------------------------------------*/
/* Exported type                                                              */
/*----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------*/
/* Exported data                                                              */
/*----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------*/
/* Constant exported data                                                     */
/*----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------*/
/* Exported Macros                                                            */
/*----------------------------------------------------------------------------*/
#define INT0_RISING_EDGE		0		
#define INT0_FALLING_EDGE		1

#define DISABLE_TEMP_MEASURE()	pinMES_EN = 0;
#define ENABLE_TEMP_MEASURE()	pinMES_EN = 1;

/*----------------------------------------------------------------------------*/
/* Exported functions                                                         */
/*----------------------------------------------------------------------------*/
void IF_DigitalIO_Init(void);
void Dio_Scan_T2(void);
void cart_stat_det(void);


#endif /* DIGITALIO_H */
